

<#assign currentPage ="${onRoadProjectPage.pageNumber}"/>
<#assign totalPage = "${onRoadProjectPage.totalPage}" />
<#assign actionUrl = "/admin/project/" />
<#assign urlParas = "" />





<#if test="${urlParas == null}">
	<#assign var="urlPage" value="">
</#if>

<#if test="${(totalPage >0)&&(currentPage <= totalPage)}">
		<#assign var="startPage" value="${currentPage - 4}" />
		<#if test="${startPage < 1}">
			<#assign var="startPage" value="1" />
		</#if>
		
		<#assign var="endPage" value="${currentPage + 4}" />
		
		<#if test="${endPage} > ${totalPage}">
			<#assign var="endPage" value="totalPage" />
		</#if>

		
		<div class="pagination">
			<#if test="${currentPage <= 8}">
				<#assign var="startPage" value="1" />
			</#if>
			
			<#if test="${(totalPage - currentPage) < 8}">
				<#assign var="endPage" value="${totalPage}" />
			</#if>
			
			<#switch test>
				<#case test="${currentPage == 1}">
					<span class="disabled prev_page">上页</span>
				<#break>
				 <#default>
				 	<a href="${actionUrl}${currentPage - 1}${urlParas}" class="prev_page">上页</a>
			</#switch>
			
			<#if test="${currentPage} > 8">
				<a href="${actionUrl}${1}${urlParas}">${1}</a>
				<a href="${actionUrl}${2}${urlParas}">${2}</a>
				<span class="gap">...</span>
			</#if>
			
	
			<#switch test>
				<#case test="${currentPage} == i">
					<span class="current">${i}</span>
				<#break>
				<#default>
					<a href="${actionUrl}${i}${urlParas}">${i}</a>
			</#switch>
	
			
			
			<#if test="(${totalPage} - ${currentPage}) >=8">
				<span class="gap">...</span>
				<a href="${actionUrl}${totalPage -1}${urlParas}">${totalPage - 1}</a>
				<a href="${actionUrl}${totalPage}${urlParas}">${totalPage}</a>
			</#if>
			
			<#switch test>
				<#case test="${currentPage} == ${totalPage}">
					<span class="disabled next_page">下页</span>
				<#break>
				<#default>
					<a href="${actionUrl}${currentPage + 1}${urlParas}" class="next_page" rel="next">下页</a>
			</#switch>		
		</div>
</#if>
